﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace UserKTXD.DCTEDU_
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies.Get("NguoiDung");
            if (Request.Cookies["NguoiDung"] != null)
            {
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                if (!Context.User.Identity.IsAuthenticated)
                {
                    FormsAuthentication.RedirectToLoginPage();
                }
                if (!Page.IsPostBack)
                {
                    lblFullName.Text = Common.GetKeyUserInfo("HoTen");
                }
            }
        }

        protected void imgToogle_Click(object sender, ImageClickEventArgs e)
        {
            if (PanelLeft.Width == 220)
            {
                MenuTitle.Visible = false;
                TreeMain.Visible = false;
                imgToogle.ImageUrl = "~/Images/hrm_05.png";
                PanelLeft.Width = 25;
                imgToogle.ToolTip = "Show menu";
            }
            else
            {
                TreeMain.Visible = true;
                MenuTitle.Visible = true;
                imgToogle.ImageUrl = "~/Images/hrm_06.png";
                PanelLeft.Width = 220;
                imgToogle.ToolTip = "Hide menu";
            }
        }

        protected void lkProfile_Click(object sender, EventArgs e)
        {

        }

        protected void lkChangePass_Click(object sender, EventArgs e)
        {
            Session.Clear();
            FormsAuthentication.SignOut();
            FormsAuthentication.RedirectToLoginPage();
        }
    }
}